﻿using System.ComponentModel;

namespace XYAC.Framework.MonitorTireMaterialOnline.DataExporter
{

    public static class clsLanguage
    {
        //static public clsLanguage()
        //{
        //    _CurLanguage = Language;
        //}
        static public string _CurLanguage;
        //static public string CurLanguage
        //{
        //    get {
        //        return _CurLanguage;
        //    }
        //}
        private static readonly string BasePath = System.IO.Path.GetDirectoryName(typeof(clsLanguage).Assembly.Location);
        static public string Language
        {
            get
            {
                IniFile file = new IniFile(BasePath + "\\System.ini");
                _CurLanguage = file.ReadString("UI", "Language");
                return _CurLanguage;
            }
            set
            {
                IniFile config = new IniFile(BasePath + "\\System.ini");
                config.WriteString("UI", "Language", value);
            }
        }
        static public void ApplyResource(Object Obj, string ObjName)
        {
            System.ComponentModel.ComponentResourceManager res = new ComponentResourceManager(Obj.GetType());
            res.ApplyResources(Obj, ObjName);
        }
    }
}
